<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/9/4
  Time: 12:09
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
    //拿到请求的编码格式
    request.setCharacterEncoding("utf-8");
    //拿到请求中携带的数据
    String name=request.getParameter("name");
    String pwd=request.getParameter("pwd");

    if ("admin".equals(name)&&"admin".equals(pwd)){
        //response.sendRedirect("sucess.jsp?name="+name);
        //request.getRequestDispatcher("sucess.jsp").forward(request,response);

        //把注册成功的用户名存入session中
        session.setAttribute("name",name);
        request.getRequestDispatcher("zhuyemian.jsp").forward(request,response);
    }else{
        response.sendRedirect("logininfo.jsp");
    }
//            String[] hobby=request.getParameterValues("channel");
//            //输出从请求中拿到的数据
//            out.println(name+" "+pwd+" "+hobby[0]);
%>
</body>
</html>
